﻿using HarmonyLib;
using RimWorld;
using SZ.Mech;

//namespace SZ.Mech
//{
[HarmonyPatch(typeof(CompProjectileInterceptor), nameof(CompProjectileInterceptor.Active), MethodType.Getter)]
public class CompProjectileInterceptor_Patch
{
    public static bool Prefix(ref CompProjectileInterceptor __instance, ref bool __result)//////
    {
        if (__instance != null && __instance.parent.def == SZ_DefOf.SZ_StatueGeneral)
        {
            if (__instance.OnCooldown || __instance.Charging || __instance.currentHitPoints == 0)
            {
                __result = false;
                return false;
            }
            else
            {
                __result = true;
                return false;
            }
        }
        return true;
    }
}


//[HarmonyPatch(typeof(CompSZProjectileInterceptor), nameof(CompSZProjectileInterceptor.Active),MethodType.Getter)]
//public class CompSZProjectileInterceptor_Patch
//{
//    public static bool Prefix(ref CompSZProjectileInterceptor __instance, ref bool __result)
//    {
//        if (__instance.OnCooldown || __instance.Charging || __instance.currentHitPoints == 0)
//        {
//            __result = false;
//        }
//        else
//        {
//            return true;
//        }
//        return true;
//    }
//}
//}
